<?php
// check if fields passed are empty
if(empty($_POST['name']) ||
   empty($_POST['email']) ||
   empty($_POST['message']) ||
   !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
   {
	echo "No arguments Provided!";
	return false;
   }
	
$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];
	
// create email body and send it	
$to = 'marcus.moeller@gmx.ch'; 
$email_subject = "Contact form submitted by:  $name";
$email_body = "You have received a new message. \n\n".
				  " Here are the details:\n \nName: $name \n".
				  "Email: $email_address\nMessage: \n$message";
  $headers = "Content-type:text/plain;charset=UTF-8" . "\r\n";
  $headers .= "From: $email_address" . "\r\n";
  $headers .= "Reply-To: $email_address" . "\r\n";
  $headers .= 'Return-Path: webmaster@freie.computer' . "\r\n";

//$headers = "From: webmaster@owncloud.ethz.ch";
//$headers .= "Reply-To: $email_address";	
mail($to,$email_subject,$email_body,$headers);
return true;			
?>
